package com.scuvc.service.impl;

import com.scuvc.entity.CarInfo;
import com.scuvc.service.CarInfoService;
import com.scuvc.utils.StaticUtils;

import java.util.List;

public class CarInfoServiceImpl implements CarInfoService {
    @Override
    public List<CarInfo> getAll() {
        return StaticUtils.carInfoDao.getAll();
    }

    @Override
    public List<CarInfo> getAllIsUser() {
        return StaticUtils.carInfoDao.getAllIsUser();
    }

    @Override
    public List<CarInfo> getAllPage(int pageNumber, int pageSize) {
        return StaticUtils.carInfoDao.getAllPage(pageNumber,pageSize);
    }

    @Override
    public List<CarInfo> getAllPageIsUser(int pageNumber, int pageSize) {
        return StaticUtils.carInfoDao.getAllPageIsUser(pageNumber,pageSize);
    }

    @Override
    public String getCarInfonByCarNo(String carNo) {
        return StaticUtils.carInfoDao.getCarInfonByCarNo(carNo);
    }

    @Override
    public int insert(CarInfo carInfo) {
        return StaticUtils.carInfoDao.insert(carInfo);
    }

    @Override
    public CarInfo getCarInfoByCarNoOne(String carNo) {
        List<CarInfo> list = StaticUtils.carInfoDao.getCarInfoByCarNo(carNo);
        if(list!=null && list.size()>0){
            return list.get(0);
        }
        return null;
    }

    @Override
    public List<CarInfo> getCarInfoByCarNo(String carNo) {
        return StaticUtils.carInfoDao.getCarInfoByCarNo(carNo);
    }

    @Override
    public List<CarInfo> getCarInfoByBrandId(Long id) {
        return StaticUtils.carInfoDao.getCarInfoByBrandId(id);
    }

    @Override
    public List<CarInfo> getCarInfoByModelId(Long id) {
        return StaticUtils.carInfoDao.getCarInfoByModelId(id);
    }

    @Override
    public List<CarInfo> getCarInfoByCategroyId(Long id) {
        return StaticUtils.carInfoDao.getCarInfoByCategroyId(id);
    }

    @Override
    public int updateCarInfo(String carNo, Long price, Double car_amount, Long deposit, Integer status, int usable) {
        return StaticUtils.carInfoDao.updateCarInfo(carNo,price,car_amount,deposit,status,usable);
    }
}
